from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session

from app import crud, schemas
from app.api import deps

router = APIRouter()


@router.get("/", response_model=list[schemas.GenerationJob])
def read_public_gallery(
    db: Session = Depends(deps.get_db),
    skip: int = 0,
    limit: int = 100,
) -> any:
    """
    Retrieve public jobs for the gallery.
    """
    jobs = crud.get_public_jobs(db, skip=skip, limit=limit)
    return jobs
